package com.cmnit.analysis.util

import org.apache.spark.sql.SparkSession

/**
 * 环境工具
 */
object EnvUtil {

  private val ssLocal = new ThreadLocal[SparkSession]()

  def put(ss: SparkSession): Unit = {
    ssLocal.set(ss)
  }

  def take(): SparkSession = {
    ssLocal.get()
  }

  def clear(): Unit = {
    ssLocal.remove()
  }
}
